<?php 
$cfg_IsCanView = true;
require_once(dirname(__FILE__)."/../include/config_base.php");
$aid = @intval($aid);
if(empty($aid)) $aid=0;
$mid = @intval($mid);
if(empty($mid)) $mid=0;
$dsql = new DedeSql();
$row = $dsql->GetOne("Select c.maintable From `#@__full_search` i left join #@__channeltype c on c.ID = i.channelid where i.aid = '$aid'; ");
if(empty($row['maintable'])) $row['maintable'] = '#@__archives';
$dsql->ExecuteNoneQuery(" Update `{$row['maintable']}` set click=click+1 where ID='$aid' ");
$dsql->ExecuteNoneQuery(" Update `#@__full_search` set click=click+1 where aid='$aid' ");
if(!empty($mid))
{
	$dsql->ExecuteNoneQuery(" Update `#@__member` set pageshow=pageshow+1 where ID='$mid' ");
}
if(!empty($view))
{
	$row = $dsql->GetOne(" Select click From `{$row['maintable']}` where ID='$aid' ");
	echo "document.write('".$row['click']."');\r\n";
}
@UpdateStat();
exit();
?>